package com.lagou.edu.service.impl;

import com.lagou.edu.service.IRedisService;
import io.lettuce.core.cluster.RedisClusterClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.Reference;
import org.springframework.stereotype.Service;
import redis.clients.jedis.JedisCluster;

/**
 * @author 陶肖寅
 * @version V1.0
 * <p>
 * date: 2020/9/4 上午10:53
 * email:fromlx@126.com
 * @Copyright: 2020-2021 城云科技(中国)有限公司
 * </p>
 */
@Service
public class RedisService implements IRedisService {
    @Autowired
    private JedisCluster jedisCluster;
    @Override
    public void addRedisData(String key, String value) {
        jedisCluster.set(key,value);
    }

    @Override
    public String getRedisData(String key) {
        return jedisCluster.get(key);
    }
}
